<script>

export default {
  name: 'BlogTag',
  data () {
    return {
      show: false,
      blogTagList: []
    }
  },
  methods: {
    init (blogId) {
      this.$axios.get('blog/tag/' + blogId).then(data => {
        if (data.length === 0) {
          this.$message.warning('暂无标签！')
          this.show = false
        } else {
          this.show = true
          this.blogTagList = [...data]
        }
      }).catch(e => e)
    }
  }
}
</script>

<template>
  <el-dialog v-if="show" title="博客评论" :visible.sync="show">
    <el-card>
      <el-tag v-for="blogTag in blogTagList" :key="blogTag.id" type="success">{{blogTag.tag.name}}</el-tag>
    </el-card>
  </el-dialog>
</template>

<style scoped lang="scss">

</style>
